package com.astar.mapper;

import com.astar.entity.UserRole;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;

/**
 * <p>
 * 用户和角色关联表 Mapper 接口
 * </p>
 *
 * @author jobob
 * @since 2020-01-17
 */

@Repository
public interface UserRoleMapper extends BaseMapper<UserRole> {


    //移除用户
    @Delete("delete FROM sys_user_role where user_id = #{userId,jdbcType=INTEGER} and role_id=#{roleId,jdbcType=INTEGER}")
    int deleteRole(UserRole userRole);

    //给角色添加用户
    int insertUserRole(UserRole userRole);
}
